home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / PicturePatience.dxr / scripts_5_foundation cards.ls < prev    next >
Encoding:
Text File  |  2002-01-25  |  1.2 KB  |  39 lines

  1. property mysuit, baserank, spriteNum
  2. global foundation, equal, currentselect, suitsgalore, suitshey, haters, fcount
  3.  
  4. on beginSprite me
  5.   fcount = fcount + 1
  6.   baserank = #ace
  7.   foundation.addProp(makesymbol(spriteNum), new(script("card pile")))
  8.   sprite(spriteNum).member = member(string(baserank) & "_" & haters[fcount], "playing cards")
  9.   fd = member(sprite(spriteNum).memberNum, "playing cards").name
  10.   mysuit = chars(fd, 5, fd.length)
  11.   if fcount = 4 then
  12.     fcount = 0
  13.   end if
  14. end
  15.  
  16. on mouseEnter me
  17.   if the clickOn <> 0 then
  18.     if (sprite(the clickOn).loc = the mouseLoc) and (the clickOn <> spriteNum) then
  19.       if foundation[makesymbol(spriteNum)].getcardcount() > 0 then
  20.         if (getlist(the clickOn).rankvalue = (foundation[makesymbol(spriteNum)].getlastcard().rankvalue + 1)) and (getlist(the clickOn).suit = foundation[makesymbol(spriteNum)].getlastcard().suit) then
  21.           equal = 1
  22.           currentselect = spriteNum
  23.         end if
  24.       else
  25.         if (getlist(the clickOn).rank = string(baserank)) and (getlist(the clickOn).suit = mysuit) then
  26.           equal = 1
  27.           currentselect = spriteNum
  28.         end if
  29.       end if
  30.     end if
  31.   end if
  32. end
  33.  
  34. on mouseLeave me
  35.   equal = 0
  36.   currentselect = 0
  37.   checkwin()
  38. end
  39.